package com.app.view.component.dialogs.pkResultView 
{
	import flash.geom.Point;
	import flash.text.TextField;
	import flash.display.MovieClip;
	
	import com.peachcastle.core.Display;
	import com.app.view.component.room.seat.Paijiu;
	
	import com.peachcastle.tools.Assert;
	
	/**
	 * ...
	 * @author kevin
	 */
	public class UserPaijiuGroup extends Display
	{
		private var _index:int = 0;
		
		private var _txtGroup:TextField = null;
		private var _txtTitle:TextField = null;
		
		private var _firstPaijiu:Paijiu = null;
		private var _secondPaijiu:Paijiu = null;
		
		private static var groupText:Array = ['莊牌1', '莊牌2', '闲牌1', '闲牌2'];
		
		public function UserPaijiuGroup(ui:MovieClip, index:int = 0) 
		{
			_index = index;
			
			super(ui);
		}
		
		override protected function initialization():void
		{
			super.initialization();
			
			//断言
			Assert.hasNot(assest, 'mc_first_paijiu', 'UserPaijiuGroup');
			Assert.hasNot(assest, 'mc_second_paijiu', 'UserPaijiuGroup');
			Assert.hasNot(assest, 'txt_group', 'UserPaijiuGroup');
			Assert.hasNot(assest, 'txt_title', 'UserPaijiuGroup');
			
			_firstPaijiu = new Paijiu(assest['mc_first_paijiu']);
			_secondPaijiu = new Paijiu(assest['mc_second_paijiu']);
			
			_txtGroup = assest['txt_group'];
			_txtGroup.text = groupText[_index - 1];
			
			_txtTitle = assest['txt_title'];
			_txtTitle.text = '';
		}

		public function show(data:Array, title:String = ''):void
		{
			showAssest();
			
			_firstPaijiu.show(data[0]);
			_secondPaijiu.show(data[1]);
			
			if (title) _txtTitle.text = title;
		}
	}

}